<?php
$appid = "wx89e781827ec4377e";
$appsecret = "2532d3e9372fa6eaf83f563204866702";
$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret=$appsecret";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$jsoninfo = json_decode($output, true);
$access_token = $jsoninfo["access_token"];
print $access_token;
//30_af8N0WoY3y9tfUQ81a4CRX8BncQ32vzQCBPnG6m4O7zdl156OIgjw4pOn2Gj6OZpUnKrFEeQ_OxZyVt4qGl0bQsaDv47j-fYbnJoccDgv9SCjSp2yEgXsxIcBqn4jbKko4wPuppEPXPVsbA5XNAdAAAJZM
?>